/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.Spring.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Schwanstei
 */
public class ValidaCampos {
    
    
        public boolean password(String pass)
        {
            
            if(pass.length()!=8)        
                return false;
            else{
                for ( int i=0; i<8; i++) 
            { 
                if(pass.charAt(i)==' ')
                  return false;
            }
                return true;}
            
        }
        
        public boolean cuenta(int cuenta)
        {
        if(cuenta>999999999 || cuenta<100000000)
            return false;
        else 
            return true;
        }
        
        public boolean materia(int clave)
        {
            if(clave>9999 || clave<0)
            return false;
            else
            return true;
        }
        
        public boolean grupo(int numero)
        {
            if(numero>99 || numero<=0)
                return false;
            else 
                return true;
        }
        
        public boolean validaH(Date hora)
        {
            Date date=new Date(System.currentTimeMillis());
            SimpleDateFormat formato=new SimpleDateFormat("HH:mm:ss");
            String horaSis= (date.getHours()+":"+date.getMinutes()+":"+date.getSeconds());
            Date horaSist=null;
            try{
            horaSist=formato.parse(horaSis);
            }
            catch (ParseException ex){ 
}
            if(horaSist==hora )
                return true;
            else
           return false;
        }
        
    
    
}
